package manong.mapper;

import manong.beans.College;
import manong.beans.CollegeQuery;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.session.RowBounds;

import java.util.List;
@Mapper
public interface CollegeMapper {
   
    long countByExample(CollegeQuery example);

   
    int deleteByExample(CollegeQuery example);

    @Delete({
        "delete from college",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

   
    @Insert({
        "insert into college (college_name, college_describe, ",
        "statu, mark)",
        "values (#{collegeName,jdbcType=VARCHAR}, #{collegeDescribe,jdbcType=INTEGER}, ",
        "#{statu,jdbcType=INTEGER}, #{mark,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(College record);

  
    int insertSelective(College record);

  
    List<College> selectByExampleWithRowbounds(CollegeQuery example, RowBounds rowBounds);

   
    College selectOneByExample(CollegeQuery example);

    List<College> selectByExample(CollegeQuery example);

  
    @Select({
        "select",
        "id, college_name, college_describe, statu, mark",
        "from college",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("manong.mapper.CollegeMapper.BaseResultMap")
    College selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") College record, @Param("example") CollegeQuery example);

    int updateByExample(@Param("record") College record, @Param("example") CollegeQuery example);

   
    int updateByPrimaryKeySelective(College record);

  
    @Update({
        "update college",
        "set college_name = #{collegeName,jdbcType=VARCHAR},",
          "college_describe = #{collegeDescribe,jdbcType=INTEGER},",
          "statu = #{statu,jdbcType=INTEGER},",
          "mark = #{mark,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(College record);

   
    int insertOrUpdate(College record);

   
    int insertOrUpdateSelective(College record);

  
    int batchInsert(@Param("list") List<College> list);

    
    int batchInsertSelective(@Param("list") List<College> list, @Param("selective") College.Column ... selective);
}